<!DOCTYPE html>
<html>

<head>
<title>添加代理</title>
<meta http-equiv="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit">

<%include("/common/include.html"){}%>
<style type="text/css">
	.required{
		display:inline-block;
		width: 30%;
	}
	.requiredx{
		display:inline-block;
		width: 89%;
	}
	label{
		text-align:right;
		width:70px;
		display:inline-block;
	}
</style>
</head>

<body>
	<div class="easyui-panel" style="width: 100%; padding: 30px 60px; border-width: 0px;">
		<form id="upPlate" method="post" class="form">
		<input class="easyui-textbox theme-textbox-radius" type="hidden" name="vehicleInformation.ids"  value="${vehicleInformation.ids! }">
			
			<div style="margin-bottom: 20px">
					<label class="label-top">型号:</label>
					<div class="required">
						<input  id = "model"  class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="vehicleInformation.model"  value="${vehicleInformation.model! }">
					</div>
					<span style="color:red">*必填项</span>
					<label class="label-top" style="margin-left:30px">品牌:</label>
					<div class="required">
						<input id = "pp"   class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="vehicleInformation.pp" value="${vehicleInformation.pp! }">
					</div>
					<span style="color:red">*必填项</span>
				</div>
			
			<div style="margin-bottom: 20px;">
				<label class="label-top">类型:</label>
				<div class="required">
					<select name="vehicleInformation.type" class="easyui-combobox theme-textbox-radius" value="${vehicleInformation.type! }" data-options="editable: false"  style="width: 100%;">
						<option value="电动车自行车"  
							<% if(vehicleInformation.type == '电动车自行车'){ %>
								selected="selected"
							<% } %>
						>电动车自行车</option>
						<option value="电动二轮车"  
							<% if(vehicleInformation.type == '电动二轮车'){ %>
								selected="selected"
							<% } %>
						>电动二轮车</option>
						<option value="电动轮椅车"  
							<% if(vehicleInformation.type == '电动轮椅车'){ %>
								selected="selected"
							<% } %>
						>电动轮椅车</option>
						<option value="电动三轮车"  
							<% if(vehicleInformation.type == '电动三轮车'){ %>
								selected="selected"
							<% } %>
						>电动三轮车</option>
						<option value="小型低速电动汽车"  
							<% if(vehicleInformation.type == '小型低速电动汽车'){ %>
								selected="selected"
							<% } %>
						>小型低速电动汽车</option>
					</select>
						
				</div>
					<!-- <div class="required">
						<input    class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="vehicleInformation.type"  value="${vehicleInformation.type! }">
					</div> -->
					<span style="color:red">*必填项</span>
				
				<label class="label-top" style="margin-left:30px">生产厂家:</label>
				<div class="required">
					<input id = "manufacturer"   class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="vehicleInformation.manufacturer" value="${vehicleInformation.manufacturer! }">
				</div>
				<span style="color:red">*必填项</span>
			</div>
					
					<div style="margin-bottom: 20px">
					<label class="label-top">生产日期:</label>
					<div class="required">
						<input id = "birthday"   class="easyui-datebox theme-textbox-radius" style="width: 100%;" name="vehicleInformation.birthday" value="${vehicleInformation.birthday! }">
					</div>
					<span style="color:red">*必填项</span>
					<label class="label-top" style="margin-left:30px">是否国产:</label>
					<div class="required">
						<select name="vehicleInformation.imports" class="easyui-combobox theme-textbox-radius"  data-options="editable: false" style="width: 100%;" value="${vehicleInformation.imports! }">
							<option value="0"  
							<% if(vehicleInformation.imports == '0'){ %>
								selected="selected"
							<% } %>
						>是</option>
						<option value="1"  
							<% if(vehicleInformation.imports == '1'){ %>
								selected="selected"
							<% } %>
						>否</option>
						</select>
					</div>
					<span style="color:red">*必填项</span>
				</div>
				
				<div style="margin-bottom: 20px">
					<label class="label-top">制造国:</label>
					<div class="required">
						<input id = "manu_contry"   class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="vehicleInformation.manu_contry"  value="${vehicleInformation.manu_contry! }">
					</div>
					<span style="color:red">*必填项</span>
					<label class="label-top"  style="margin-left:30px">车身质量:</label>
					<div class="required">
						<input id = "weight"   class="easyui-numberspinner inputBox theme-textbox-radius" style="width: 90%;" labelposition="after" name="vehicleInformation.weight" data-options="increment:0.1,min:1,max:100000,precision:2,label:'公斤'" value="${vehicleInformation.weight! }" >
					</div>
					<span style="color:red">*必填项</span>
				</div>
				
				<div style="margin-bottom: 20px">
					<label class="label-top">长:</label>
					<div class="required">
						<input id = "chang"   class="easyui-numberspinner inputBox theme-textbox-radius" style="width: 100%;" labelposition="after"  name="vehicleInformation.chang" data-options="increment:0.1,min:1,max:100000,precision:2,label:'cm'" value="${vehicleInformation.chang! }">
					</div>
					<span style="color:red">*必填项</span>
					<label class="label-top" style="margin-left:30px">宽:</label>
					<div class="required">
						<input id = "width"   class="easyui-numberspinner inputBox theme-textbox-radius"   labelposition="after"style="width: 90%;" name="vehicleInformation.width" data-options="increment:0.1,min:1,max:100000,precision:2,label:'cm'" value="${vehicleInformation.width! }">
					</div>
					<span style="color:red">*必填项</span>
				</div>
				
				<div style="margin-bottom: 20px">
					
					<label class="label-top" >高:</label>
					<div class="required">
						<input id = "height"   class="easyui-numberspinner inputBox theme-textbox-radius"  labelposition="after"style="width: 100%;" name="vehicleInformation.height" data-options="increment:0.1,min:1,max:100000,precision:2,label:'cm'" value="${vehicleInformation.height! }" >
					</div>
					<span style="color:red">*必填项</span>
				
					<label class="label-top" style="margin-left:30px">颜色:</label>
					<div class="required">
						<select name="vehicleInformation.color" data-options="editable: false"  style="width: 100%;" class="easyui-combobox theme-textbox-radius"  >
							<option value="红色"  
							<% if(vehicleInformation.color == '红色'){ %>
								selected="selected"
							<% } %>
							>红色</option>
							<option value="白色"  
								<% if(vehicleInformation.color == '白色'){ %>
									selected="selected"
								<% } %>
							>白色</option>
							<option value="黑色"  
								<% if(vehicleInformation.color == '黑色'){ %>
									selected="selected"
								<% } %>
							>黑色</option>
							<option value="粉色"  
								<% if(vehicleInformation.color == '粉色'){ %>
									selected="selected"
								<% } %>
							>粉色</option>
							<option value="绿色"  
								<% if(vehicleInformation.color == '绿色'){ %>
									selected="selected"
								<% } %>
							>绿色</option>
							<option value="蓝色"  
								<% if(vehicleInformation.color == '蓝色'){ %>
									selected="selected"
								<% } %>
							>蓝色</option>
							<option value="橙色"  
								<% if(vehicleInformation.color == '橙色'){ %>
									selected="selected"
								<% } %>
							>橙色</option>
							<option value="紫色"  
								<% if(vehicleInformation.color == '紫色'){ %>
									selected="selected"
								<% } %>
							>紫色</option>
							<option value="黄色"  
								<% if(vehicleInformation.color == '黄色'){ %>
									selected="selected"
								<% } %>
							>黄色</option>
							<option value="棕色"  
								<% if(vehicleInformation.color == '棕色'){ %>
									selected="selected"
								<% } %>
							>棕色</option>
							<option value="其他"  
								<% if(vehicleInformation.color == '其他'){ %>
									selected="selected"
								<% } %>
							>其他</option>
						</select>
					</div>
					<span style="color:red">*必填项</span>
					
				</div>
			<div style="margin-bottom: 20px">
					<label class="label-top" >功率:</label>
					<div class="required">
						<input id = "gl"   class="easyui-numberspinner inputBox theme-textbox-radius" labelposition="after" style="width: 100%;" name="vehicleInformation.gl"  value="${vehicleInformation.gl!}"    data-options="increment:0.1,min:1,max:100000,precision:2,label:'W'" >
					</div>
					<span style="color:red">*必填项</span>
				</div>
		
			
			<div id="partVal" style="display: none;">
			
			</div>
		
		</form>

	</div>
	
	<script type="text/javascript">
		
		//@ sourceURL=mmm.js
		var $form = $('#upPlate');

		var submitNow = function($dialog, $grid, $tree, $pjq) {
			
			$("#partVal").html($("#partText").html());
			var model=$('#model').val();
			var pp=$('#pp').val();
			var manufacturer=$('#manufacturer').val();
			var birthday=$('#birthday').val();
			var manu_contry=$('#manu_contry').val();
			var weight=$('#weight').val();
			var chang=$('#chang').val();
			var width=$('#width').val();
			var height=$('#height').val();
			var gl=$('#gl').val();
			if(model==null||model==""|| (model.length>0 && model.trim().length == 0)){
				$.alert(parent.$, "型号不能为空！");
				return false;
			}
			if(pp==null|| pp==""||(pp.length>0 && pp.trim().length == 0)){
				$.alert(parent.$, "品牌不能为空！");
				return false;
			}
			if(manufacturer==null|| manufacturer==""||(manufacturer.length>0 && manufacturer.trim().length == 0)){
				$.alert(parent.$, "生产厂家不能为空！");
				return false;
			}
			if(birthday==null||birthday==""|| (birthday.length>0 && birthday.trim().length == 0)){
				$.alert(parent.$, "生产日期不能为空！");
				return false;
			}
			if(manu_contry==null||manu_contry==""|| (manu_contry.length>0 && manu_contry.trim().length == 0)){
				$.alert(parent.$, "制造国不能为空！");
				return false;
			}
			if(weight==null||weight.length==0){
				$.alert(parent.$, "车身质量不能为空！");
				return false;
			}
			if(chang==null||chang.length==0){
				$.alert(parent.$, "长不能为空！");
				return false;
			}
			if(width==null||width.length==0){
				$.alert(parent.$, "宽不能为空！");
				return false;
			}
			if(height==null||height.length==0){
				$.alert(parent.$, "高不能为空！");
				return false;
			}
			if(gl==null||gl.length==0){
				$.alert(parent.$, "功率不能为空！");
				return false;
			}
			var url = "${cxt!}/vehicleInformation/upVehicle";
			$.post(url, sy.serializeObject($form), function(result) {
				if (result.code == '200') {
					$grid.datagrid('reload');
					$.slideMsg("修改成功！", $pjq);
					$dialog.dialog('destroy');
				} else {
					$.alert($pjq, result.msg);
				}
			}, 'json');
		};
		var submitForm = function($dialog, $grid, $tree, $pjq) {
			submitNow($dialog, $grid, $tree, $pjq);
			// 					$form.isValid(function(isValied){
			// 						if(isValied){
			// 							submitNow($dialog, $grid, $pjq);
			// 						}
			// 					});
		};
	</script>
</body>
</html>